<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>controlP5 : : Button</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
document.getElementsByTagName('html')[0].className = 'isjs';

function toggle(dt) 
{ 
  var display, dd=dt; 
  /* get dd */ 
  do{ dd = dd.nextSibling } while(dd.tagName!='DD'); 
  toOpen =!dd.style.display; 
  dd.style.display = toOpen? 'block':'' 
  dt.getElementsByTagName('span')[0].innerHTML 
    = toOpen? '-':'+' ; 
} 
</script>
</head>
<body>
<div id="container">
		<div id="header">
		<a href="./index.htm"><img src="./docuImages/title.jpg" /></a>
		</div>
	<div class="content">
		<h1>Button</h1>
		<dl><dt class="key">description</dt><dd class="value">a button executes after release and can be applied to methods and functions.
 for a full documentation of this controller see the <a
 href="./controller_class_controller.htm">controller</a> class.</dd></dl>
			
			<div class="toggleList example">
				<dl><dt onclick="toggle(this)"><span>+</span>Example</dt>
					<dd><pre>import controlP5.*;

ControlP5 controlP5;

int myColorBackground = color(0,0,0);

int buttonValue = 1;

void setup() {
  size(400,400);
  controlP5 = new ControlP5(this);
  controlP5.addButton("button",10,100,160,80,20).setId(1);
  controlP5.addButton("buttonValue",4,100,190,80,20).setId(2);
}
  
void draw() {
  background(buttonValue*10);
}

void controlEvent(ControlEvent theEvent) {
  println(theEvent.controller().id());
}


void button(float theValue) {
  println("a button event. "+theValue);
}
</pre></dd>
				</dl>
			</div>
			
			
			
			<dl><dt class="key">constructors</dt><dd class="value"><pre>Button();
Button(theControlP5, theName);
</pre></dd></dl>
			
			
			
			
			
			
			
			<!-- METHODS:BEGIN -->
			
       <dl class="noborder"><dt>Methods</dt></dl>
       <dl><dt class="key"><a href="button_method_setvalue.htm">setValue ( )</a></dt><dd class="value">set the value of the button controller.</dd></dl>

   
			<!-- METHODS:END -->
			<div class="separator">
			<dl><dt class="key">usage</dt><dd class="value">Web & Application</dd></dl>
			</div>
			<div class="separator">
			<dl><dt class="key">related</dt><dd class="value"><ul><li><a href="controller_class_controller.htm">Controller</a></li>
</ul></dd></dl>
			</div>
	</div>
	<div id="footer">
	<p>by andreas schlegel (<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank">cc</a>) 2007, <a href="http://www.sojamo.de" target="_blank">sojamo</a>.</p>
	</div>
</div>
</body>
</html>


